class Solution {
public:
    int findMinArrowShots(vector<vector<int>>& points) {
        sort(points.begin(),points.end());

        int right=points[0][1];
        int ret=1;
        for(int i=1;i<points.size();i++)
        {
            if(right>=points[i][0])
            {
                right=min(right,points[i][1]);
            }
            else{
                ret++;
                right=points[i][1];
            }
        }
        return ret;
    }
};
